
#include <iostream>
#include <string>
#include <memory>
#include <functional>
#include "TcpServer.hpp"
#include"Http.hpp"
using std::cout;
using std::endl;

void Usage(const char *arg)
{
    cout << "USAGE:" << endl;
    cout << "#         please enter: " << arg << "serverport" << endl;
}
// ./server 8888
int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        Usage(argv[0]);
        exit(1);
    }
    EnableFile();
    uint16_t port = std::stoi(argv[1]);
HttpServer hs;
    std::unique_ptr<TcpServer> uptr = std::make_unique<TcpServer>(port, std::bind(&HttpServer::HandlerHttpRequest, &hs, std::placeholders::_1));
    uptr->StartServer();
    return 0;
}

